<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
       <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
      /*  .row {
         
            margin: 0 auto;
        }
        .trBackgroundColor {
            background: #c5e1fe
        }*/
        ul li{list-style: none;}
        .da_table tr td .textW{max-width: 60%;height:22px;display: inline-block;}
        .colorRed{color:red;}
        .da_table tr td .select2{width: 60%;height: 22px;}
        .mlR{margin:0 5px;}
        .textR{text-align: right;}
        .this_tableInfo_alert{display: none;}

    </style>

</head>

<body class="white-bg x_sorll" style="color:#333;padding:3px;">
<div class="white-bg setRemindPeopleK">
<div class="page-heade">
       <h2 class="title_color text-center">网点回收站</h2>
    </div>
    <form action="" class="form-inline" id="">
        <table class="table table-bordered white-bg" style="margin-bottom:0px">
            <tr>
                <td colspan="9">

                    <select name="lendone" id="" class="form-control outNet">
                        <option value="0">导出网点</option>
                        <option value="1">导出导入版Excel</option>
                        <option value="2">导出完整版Excel</option>
                    </select>

                    <button class="btn btn-warning" style="float: right;" id="fanhui">返回</button>
                </td>
            </tr>
        </table>
    </form>
    <form action="" class="form-inline" id="">
        <table class="table table-bordered white-bg" style="margin-top:0;border-top-width: 0;{if isset($zhankai)&&$zhankai==1}display:none;{else}display: block;{/if}">
            <tr>
                <td class="text-right" style="border-top-width: 0;"><label for="sn">网点编号：</label></td>
                <td style="border-top-width: 0;"><input type="text" class="form-control inputremindPeple" id="sn" name="sn" value="{$sn}"></td>
                <td class="text-right" style="border-top-width: 0;"><label for="AgencyName">网点名称：</label></td>
                <td style="border-top-width: 0;"><input type="text" class="form-control inputremindPeple" id="AgencyName" name="title" value="{$title}"></td>
                <td class="text-right" style="border-top-width: 0;"><label for="city">网点所属城市：</label></td>
                <td style="border-top-width: 0;"><input type="text" class="form-control inputremindPeple" name="city" id="city" value="{$city}"></td>
                <td colspan="3" style="border-top-width: 0;"><button class="btn btn-info">查询</button> <button class="btn btn-info" id="moreQueryIf">更多查询条件</button></td>

            </tr>
        </table>
    </form>
    <form action="" class="form-inline" id="form1" method="get">
        <input type="hidden" name="zhankai"  value="1">
        <table class="table da_table white-bg" style="margin-bottom:0;{if isset($zhankai)&&$zhankai==1}display:block;{else}display: none;{/if}" id="moreTable">
            <tr>
                <td class="text-right"><label for="sn1">网点编号：</label></td>
                <td><input name="sn" id="sn1" value="{$sn}" type="text" class="form-control textW"></td>
                <td class="text-right"><label for="title1">网点名称：</label></td>
                <td><input name="title" value="{$title}" type="text" id="title1" class="form-control textW"></td>
                <td class="text-right"><label for="systemName1">网点所属城市：</label></td>
                <td><input name="city" value="{$city}" type="text" id="systemName1" class="form-control textW"></td>
            </tr>
            <tr>
                <td class="text-right"><label for="zone">网点所属分区：</label></td>
                <td><input name="zone" value="{$zone}" type="text" id="zone" class="form-control textW"></td>
                <td class="text-right"><label for="provice">网点所属省份：</label></td>
                <td><input type="text" value="{$provice}" name="provice" id="provice" class="form-control textW"></td>
                <td class="text-right"><label for="duojxs">网点有多个经销商显示方法：</label></td>
                <td>
                    <select name="duojxs" id="duojxs" class="form-control select2">
                        <option value="1" {if isset($duojxs)&&$duojxs==1}selected{/if}>网点只显示一条</option>
                        <option value="2"{if !isset($duojxs)||(isset($duojxs)&&$duojxs==2)}selected{/if}>根据所属经销商(供应商)显示多条</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="text-right"><label for="oneCType">一级渠道：</label></td>
                <td><input type="text" class="form-control textW" name="oneCType" value="{$oneCType}" id="oneCType"></td>
                <td class="text-right"><label for="twoCType">二级渠道：</label></td>
                <td><input type="text" class="form-control textW" name="twoCType" value="{$twoCType}" id="twoCType"></td>
                <td class="text-right"><label for="cate">网点类型：</label></td>
                <td>
                    <select name="cate" id="cate" class="form-control select2">
                        <option value="">请选择网点类型</option>
                        {volist name="cat" id="row"}
                        <option value="{$row.id}" {if isset($cate)&&$cate==$row.id}selected{/if}>{$row.title}</option>
                        {/volist}
                    </select>
                </td>
            </tr>
            <tr>
                <td class="text-right"><label for="iskey">重点网点：</label></td>
                <td>
                    <select name="iskey" id="iskey" class="form-control select2">
                        <option value="">全部</option>
                        <option value="1" {if isset($iskey)&&$iskey==1}selected{/if}>是</option>
                        <option value="0" {if isset($iskey)&&$iskey=='0'}selected{/if}>否</option>
                    </select>
                </td>
                <td class="text-right"><label for="guide">导购网点：</label></td>
                <td>
                    <select name="guide" id="guide" class="form-control select2">
                        <option value="">全部</option>
                        <option value="1" {if isset($guide)&&$guide==1}selected{/if}>是</option>
                        <option value="0" {if isset($guide)&&$guide=='0'}selected{/if}>否</option>
                    </select>
                </td>
                <td class="text-right"><label for="direct">直营网点：</label></td>
                <td>
                    <select name="direct" id="direct" class="form-control select2">
                        <option value="">全部</option>
                        <option value="1" {if isset($direct)&&$direct==1}selected{/if}>是</option>
                        <option value="0" {if isset($direct)&&$direct=='0'}selected{/if}>否</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="text-right"><label for="sample">样板网点：</label></td>
                <td>
                    <select name="sample" id="sample" class="form-control select2">
                        <option value="">全部</option>
                        <option value="1" {if isset($sample)&&$sample==1}selected{/if}>是</option>
                        <option value="0" {if isset($sample)&&$sample=='0'}selected{/if}>否</option>
                    </select>
                </td>
                <td class="text-right"><label for="">网点等级：</label></td>
                <td>
                    <select name="grade" id="grade" class="form-control select2">
                        <option value="">请选择网点等级</option>
                        {if isset($grade)}
                        {volist name="grade" id="row"}
                        <option value="{$row.id}" {if isset($grade_s)&&$grade_s==$row.id}selected{/if}>{$row.title}</option>
                        {/volist}
                        {/if}
                    </select>
                </td>
                <td class="text-right"><label for="jxs_sn">经销商编号：</label></td>
                <td><input type="text" class="form-control textW" id="jxs_sn" name="jxs_sn" value="{$jxs_sn}"></td>
            </tr>
            <tr>
                <td class="text-right"><label for="jxs_title">经销商名称：</label></td>
                <td><input type="text" class="form-control textW" id="jxs_title" name="jxs_title" value={$jxs_title}></td>
                <td class="text-right"><label for="jxs_zoning">经销商所属分区：</label></td>
                <td><input type="text" class="form-control textW" id="jxs_zoning" name="jxs_zoning" value="{$jxs_zoning}"></td>
                <td class="text-right"><label for="jxs_provice">经销商所属省份：</label></td>
                <td><input type="text" class="form-control textW" id="jxs_provice" name="jxs_provice" value="{$jxs_provice}"></td>
            </tr>
            <tr>
                <td class="text-right"><label for="jxs_city">经销商所属城市：</label></td>
                <td><input type="text" class="form-control textW" id="jxs_city" name="jxs_city" value="{$jxs_city}"></td>
                <td class="text-right"><label for="system_sn">系统编号：</label></td>
                <td><input type="text" class="form-control textW" id="system_sn" name="system_sn" value="{$system_sn}"></td>
                <td class="text-right"><label for="system_title">系统名称：</label></td>
                <td><input type="text" class="form-control textW" id="system_title" name="system_title" value="{$system_title}"></td>
            </tr>
            <tr>
                <td class="text-right"><label for="stuff">业务人员：</label></td>
                <td><input type="text" class="form-control textW" id="stuff" name="stuff" value="{$stuff}"></td>
                <td class="text-right"><label for="address">地址和经纬度：</label></td>
                <td>
                    <select name="address" id="address" class="form-control select2">
                        <option value="">请选择</option>
                        <option value="1" {if isset($address)&&$address==1}selected{/if}>无地址有经纬度的网点</option>
                        <option value="2" {if isset($address)&&$address==2}selected{/if}>有地址无经纬度的网点</option>
                        <option value="3" {if isset($address)&&$address==3}selected{/if}>无地址无经纬度的网点</option>
                        <option value="4" {if isset($address)&&$address==4}selected{/if}>有地址有经纬度的网点</option>
                    </select>
                </td>
                <td colspan="2"></td>
            </tr>
            <tr>
                <td colspan="6" class="text-center"><button class="btn btn-info">查询</button><button class="btn btn-info" style="margin:0 10px" id="reset">清空查询条件</button> <button class="btn btn-info" id="packQueryIf">收起查询条件</button></td>
            </tr>

        </table>

    </form>
    <div class="row no-padding">

        <table class="table table-bordered table-hover agencyM_table text-center">

            <thead>
                <tr class="info">
                    <th>No.</th>
                    <th>网点编号</th>
                    <th>网点名称</th>
                    <th>所属分区(网点)</th>
                    <th>所属省份(网点)</th>
                    <th>所属城市(网点)</th>
                    <th>业务人员(网点)</th>
                    <th>所属系统编号</th>
                    <th>所属系统</th>
                    <th>所属经销商编号</th>
                    <th>所属经销商</th>
                    <th>所属分区(经销商)</th>
                    <th>所属省份(经销商)</th>
                    <th>所属城市(经销商)</th>
                    <th>分区负责人(经销商)</th>
                    <th>省份负责人(经销商)</th>
                    <th>城市负责人(经销商)</th>
                    <th>业务人员(经销商)</th>
                    <th>行政省</th>
                    <th>行政市</th>
                    <th>行政区县</th>
                    <th>详细地址</th>
                    <th>一级渠道</th>
                    <th>二级渠道</th>
                    <th>网点类型</th>
                    <th>店面面积(平方米)</th>
                    <th>收银台数</th>
                    <th>同品类货架节数(各产品)</th>
                </tr>
            </thead>
            <tbody>
                {volist name="data" id="row" key="k"}
                <tr class="angency_tableInfo">
                    <td class="NoId">{$k}</td>
                    <td>{$row.sn}</td>
                    <td><a href="javascript:;" class="netNameA">{$row.title}</a></td>
                    <td>{$row.zoning}</td>
                    <td><a href="javascript:;">{$row.provice}</a></td>
                    <td>{$row.city}</td>
                    <td>{$row.stuff}</td>
                    <td>{$row.system_sn}</td>
                    <td>{$row.system_title}</td>
                    <td>{$row.system_jxs_sn}</td>
                    <td>{$row.system_jxs_title}</td>
                    <td>{$row.system_jxs_zoning}</td>
                    <td>{$row.system_jxs_provice}</td>
                    <td>{$row.system_jxs_city}</td>
                    <td>{$row.system_jxs_zoning_head}</td>
                    <td>{$row.system_jxs_provice_head}</td>
                    <td class="NoId">{$row.system_jxs_city_head}</td>
                    <td>{$row.system_jxs_stuff}</td>
                    <td><a href="javascript:;">{$row.exec_provice}</a></td>
                    <td>{$row.exec_city}</td>
                    <td><a href="javascript:;">{$row.exec_county}</a></td>
                    <td>{$row.detailAddress}</td>
                    <td>{$row.oneCType}</td>
                    <td>{$row.twoCType}</td>
                    <td>{$row.cat}</td>
                    <td>{$row.area}</td>
                    <td>{$row.cashiers}</td>
                    <td>{$row.shelf_num}</td>
                </tr>
                <tr class="this_tableInfo_alert">
                    <td colspan="28">
                        <ul style="">
                            <li style="text-align: left;">

                                <a href="{:url('qiyong',array('id'=>$row.id))}" class="qiyong">启用</a>
                            </li>
                        </ul>
                    </td>
                </tr>
                {/volist}
            </tbody>
        </table>
        <div class="col-md-12 white-bg" style="padding: 20px 0;text-align: center;">
            {$page}
        </div>
    </div>
</div>

<!-- 全局js -->
{include file="Public/footer"}
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script>
    $(document).ready(function () {

        $(".angency_tableInfo>td>.netNameA").click(function() {
            $(this).parents("tr").next(".this_tableInfo_alert").toggle().siblings(".this_tableInfo_alert").hide();
            $(this).parents("tr").addClass("trBackgroundColor").siblings("tr").removeClass("trBackgroundColor");
        })

        $("#moreQueryIf").click(function(){
            $(this).parent().parent().hide()
            $("#moreTable").show()
            return false
        })
        $("#packQueryIf").click(function(){
            $("#form1 input").each(function(){
                $(this).val('');
            });
            $("#form1 select").each(function(){
                $(this).val('');
            });
            $("#moreTable").hide();
            $("#moreQueryIf").parent().parent().show();
            return false
        })



        //清除查询条件
        $('#reset').on('click',function () {
            $("#form1 input").each(function(){
                $(this).val('');
            });
            $("#form1 select").each(function(){
                $(this).val('');
            });
            $('#form1').submit()
            return false
        })

        //启用
        $('.qiyong').click(function () {
            var link = $(this).attr('href')
            swal({
                title: "您确定启用吗",
                text: "",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "确定",
                closeOnConfirm: false
            }, function (isConfirm) {
                if(isConfirm){
                    $.ajax({
                        'type':'post',
                        'url':link,
                        'dataType':'json',
                        'success':function (data) {
                            if(data.success){
                                location.reload()
                            }else
                                swal(data.msg, "", "error");
                        }
                    })
                }

            });
            return false
        });
        $('#fanhui').on('click',function(){
            parent.location.reload();
        })

    })
</script>
</body>

</html>